package com.qf.entity;

//管理员的实体类

import java.io.Serializable;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;

public class Admin implements Serializable {

    private  String username;
    private  String password;
    private  String name;
    private  String sex;
    private  Date brithday;
    private  List<String> powers;
    private  String jiguan;
    private  String header;

    @Override
    public String toString() {
        return "Admin{" +
                "username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", name='" + name + '\'' +
                ", sex='" + sex + '\'' +
                ", brithday=" + brithday +
                ", powers=" + powers +
                ", jiguan='" + jiguan + '\'' +
                ", header='" + header + '\'' +
                '}';
    }


    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public Date getBrithday() {
        return brithday;
    }

    public void setBrithday(Date brithday) {
        this.brithday = brithday;
    }
    public  void setBrithday(String brithday){
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-dd-mm");
        try {
            this.brithday=simpleDateFormat.parse(brithday);
        } catch (ParseException e) {
            e.printStackTrace();
        }
    }
    public List<String> getPower() {
        return powers;
    }

    public void setPower(List<String> powers) {
        this.powers = powers;
    }
    public  void setPower(String[] powers){
        this.powers = Arrays.asList(powers);
    }
    public  void addPower(String power){
        if (this.powers ==null){
            this.powers =new ArrayList<>();
        }
        this.powers.add(power);
    }
    public String getJiguan() {
        return jiguan;
    }

    public void setJiguan(String jiguan) {
        this.jiguan = jiguan;
    }

    public String getHeader() {
        return header;
    }

    public void setHeader(String header) {
        this.header = header;
    }
}
